﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using JX.Infrastructure.Attribute;
using JX.Infrastructure.Common;

namespace JX.Core.Entity
{
	/// <summary>
	/// 数据库表：Nodes 的实体类.
	/// </summary>
	public partial class NodesEntity
	{
		/// <summary>
		/// 节点设置对像
		/// </summary>
		public NodeSettingInfo SettingsInfo
		{
			get
			{
				if(string.IsNullOrEmpty(Settings))
				{
					return new NodeSettingInfo(true);
				}
				return Settings.ToXmlObject<NodeSettingInfo>();
			}
		}

		/// <summary>
		/// 节点IP设置对像
		/// </summary>
		public NodeIPLockInfo IPLockInfo
		{
			get
			{
				if (string.IsNullOrEmpty(IPLock))
				{
					return new NodeIPLockInfo(true);
				}
				return IPLock.ToXmlObject<NodeIPLockInfo>();
			}
		}
	}
}
